<%@ page language="java" contentType="text/html; charset=utf-8"pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>新增技师类型</title>
		<link href="<c:url value="/resources/css/style.css" />" rel="stylesheet" type="text/css">
		<link href="<c:url value="/resources/css/default/easyui.css" />" rel="stylesheet" type="text/css">
		<link href="<c:url value="/resources/css/icon.css" />" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="<c:url value="/resources/js/jquery-1.7.2.js" />"></script>
		<script type="text/javascript" src="<c:url value="/resources/js/jquery.easyui.min.js" />"></script>
		<script type="text/javascript" src="<c:url value="/resources/js/easyui-lang-zh_CN.js" />"></script>
		<script type="text/javascript">
			$(function(){
				if('${result}' != null && '${result}' != ''){
					$.messager.alert('操作结果','${result}');
				}
			});
		
			function clearForm(){
				$("#worker_type_name").val('');
				$("#seq").val('');
				$("#printer_no").val('');
			}
			
			function submitForm(){
				var flag = "false";
				$.ajax({
					url:'checkWorkerTypeName.do',
					data:{'workerType':$.trim($("#worker_type_name").val())},
					type:'post',
					dataType:'json',
					async:false,
					cache:false,
					success:function(data){
						flag = data.toString();
					}
				});
				
				if(flag == 'true'){
					$.messager.alert('操作结果','技师类型已存在','warning');
					return false;
				}
				
				$("#addWorkerTypeForm").submit();
			}
		</script>
	</head>
	
	<body>
		<div class="easyui-panel" title="新增技师类型" fit="true">
			<div style="padding:10px 0 10px 60px; text-align: right;">
				<form name="addWorkerTypeForm" id="addWorkerTypeForm" method="post" action="addWorkerType">
					<table  style="text-align: center; border:1px;width:400px;">
						<tr>
							<td align="right" style="height:28px;">技师类型：</td>
	    					<td align="left">
	    						<input class="easyui-validatebox" style="width:150px;" type="text" 
	    							name="worker_type_name" id="worker_type_name" required="true" />
	    					</td>
						</tr>
						
						<tr>
							<td align="right" style="height:28px;">显示顺序 ：</td>
	    					<td align="left">
	    						<input class="easyui-numberbox" style="width:150px;" type="text" name="seq" id="seq" data-options="required:true" />
	    					</td>
						</tr>
						
						<tr>
							<td align="right" style="height:28px;">派工打印机：</td>
	    					<td align="left">
	    						<input class="easyui-numberbox" style="width:150px;" type="text" name="printer_no" id="printer_no"  />
	    					</td>
						</tr>
					</table>
				</form>
			</div>
			
			<div style="margin-left:170px;padding:5px">
	    		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">保存</a>
	    		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">重置</a>
	    	</div>
		</div>
	</body>
</html>